﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Compilex.Syntatic
{
    public class VariableDescriptor : SymbolDescriptor
    {
        public VariableDescriptor()
        {
            this.Size = 0;
            this.IsArray = false;
        }

        public VariableDescriptor(SymbolType type)
        {
            this.Type = type;
        }
        public SymbolType Type { get; set; }
        /// <summary>
        /// Vale 0 para variáveis normais
        /// </summary>
        public int Size { get; set; }
        public bool IsArray { get; set; }
        public bool IsParam { get; set; }
        public object DefaultValue { get; set; }
        public int StackOffset { get; set; }
        public int SizeBytes
        {
            get
            {
                return Size == 0 ? Type.SizeBytes : Type.SizeBytes * Size;
            }
        }
    }
}
